home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / widget / nsIMenu.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  5KB  |  198 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 1998
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *
  24.  * Alternatively, the contents of this file may be used under the terms of
  25.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  26.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  27.  * in which case the provisions of the GPL or the LGPL are applicable instead
  28.  * of those above. If you wish to allow use of your version of this file only
  29.  * under the terms of either the GPL or the LGPL, and not to allow others to
  30.  * use your version of this file under the terms of the MPL, indicate your
  31.  * decision by deleting the provisions above and replace them with the notice
  32.  * and other provisions required by the GPL or the LGPL. If you do not delete
  33.  * the provisions above, a recipient may use your version of this file under
  34.  * the terms of any one of the MPL, the GPL or the LGPL.
  35.  *
  36.  * ***** END LICENSE BLOCK ***** */
  37.  
  38. #ifndef nsIMenu_h__
  39. #define nsIMenu_h__
  40.  
  41. #include "nsISupports.h"
  42. #include "nsStringFwd.h"
  43.  
  44. class nsIDocShell;
  45. class nsIMenuBar;
  46. class nsIMenu;
  47. class nsIMenuItem;
  48. class nsIMenuListener;
  49. class nsIChangeManager;
  50. class nsIContent;
  51. class nsIMenuCommandDispatcher;
  52.  
  53.  
  54. // {ab6cea83-00ff-11d5-bb6f-f432a43ead7c}
  55. #define NS_IMENU_IID      \
  56. { 0xab6cea83, 0x00ff, 0x11d5, \
  57.   { 0xbb, 0x6f, 0xf4, 0x32, 0xa4, 0x3e, 0xad, 0x7c } };
  58.  
  59.  
  60. /**
  61.  * Menu widget
  62.  */
  63. class nsIMenu : public nsISupports {
  64.  
  65.   public:
  66.     NS_DEFINE_STATIC_IID_ACCESSOR(NS_IMENU_IID)
  67.  
  68.   /**
  69.     * Creates the Menu
  70.     *
  71.     */
  72.     NS_IMETHOD Create ( nsISupports * aParent, const nsAString &aLabel, const nsAString &aAccessKey, 
  73.                           nsIChangeManager* aManager, nsIDocShell* aShell, nsIContent* aNode ) = 0;
  74.  
  75.    /**
  76.     * Get the Menu's Parent
  77.     *
  78.     */
  79.     NS_IMETHOD GetParent(nsISupports *&aParent) = 0;
  80.  
  81.    /**
  82.     * Get the Menu label
  83.     *
  84.     */
  85.     NS_IMETHOD GetLabel(nsString &aText) = 0;
  86.  
  87.    /**
  88.     * Set the Menu label
  89.     *
  90.     */
  91.     NS_IMETHOD SetLabel(const nsAString &aText) = 0;
  92.  
  93.     /**
  94.     * Get the Menu Access Key
  95.     *
  96.     */
  97.     NS_IMETHOD GetAccessKey(nsString &aText) = 0;
  98.    
  99.     /**
  100.     * Set the Menu Access Key
  101.     *
  102.     */
  103.     NS_IMETHOD SetAccessKey(const nsAString &aText) = 0;
  104.  
  105.     /**
  106.     * Set the Menu enabled state
  107.     *
  108.     */
  109.     NS_IMETHOD SetEnabled(PRBool aIsEnabled) = 0;
  110.  
  111.     /**
  112.     * Get the Menu enabled state
  113.     *
  114.     */
  115.     NS_IMETHOD GetEnabled(PRBool* aIsEnabled) = 0;
  116.     
  117.     /**
  118.     * Query if this is the help menu. Mostly for MacOS voodoo.
  119.     *
  120.     */
  121.     NS_IMETHOD IsHelpMenu(PRBool* aIsHelpMenu) = 0;
  122.     
  123.     /**
  124.     * Adds a Menu Item
  125.     *
  126.     */
  127.     NS_IMETHOD AddItem(nsISupports* aItem) = 0;
  128.  
  129.    /**
  130.     * Adds a separator
  131.     *
  132.     */
  133.     NS_IMETHOD AddSeparator() = 0;
  134.  
  135.    /**
  136.     * Returns the number of menu items
  137.     * This does count separators as items
  138.     */
  139.     NS_IMETHOD GetItemCount(PRUint32 &aCount) = 0;
  140.  
  141.    /**
  142.     * Returns a Menu or Menu Item at a specified Index
  143.     *
  144.     */
  145.     NS_IMETHOD GetItemAt(const PRUint32 aPos, nsISupports *& aMenuItem) = 0;
  146.  
  147.    /**
  148.     * Inserts a Menu Item at a specified Index
  149.     *
  150.     */
  151.     NS_IMETHOD InsertItemAt(const PRUint32 aPos, nsISupports * aMenuItem) = 0;
  152.  
  153.    /**
  154.     * Removes an Menu Item from a specified Index
  155.     *
  156.     */
  157.     NS_IMETHOD RemoveItem(const PRUint32 aPos) = 0;
  158.  
  159.    /**
  160.     * Removes all the Menu Items
  161.     *
  162.     */
  163.     NS_IMETHOD RemoveAll() = 0;
  164.  
  165.    /**
  166.     * Gets Native MenuHandle
  167.     *
  168.     */
  169.     NS_IMETHOD  GetNativeData(void** aData) = 0;
  170.  
  171.    /**
  172.     * Sets Native MenuHandle
  173.     *
  174.     */
  175.     NS_IMETHOD  SetNativeData(void* aData) = 0;
  176.     
  177.    /**
  178.     * Adds menu listener for dynamic construction
  179.     *
  180.     */
  181.     NS_IMETHOD AddMenuListener(nsIMenuListener * aMenuListener) = 0;
  182.  
  183.    /**
  184.     * Removes menu listener for dynamic construction
  185.     *
  186.     */
  187.     NS_IMETHOD RemoveMenuListener(nsIMenuListener * aMenuListener) = 0;
  188.  
  189.    /**
  190.     * Get GetMenuContent
  191.     *
  192.     */
  193.     NS_IMETHOD GetMenuContent(nsIContent ** aMenuContent) = 0;
  194.     
  195. };
  196.  
  197. #endif
  198.